package bean;

import java.util.List;

public class Page<T> {
    private Integer pageNumber;     //当前页码
    private Integer pageTotal;      //总页数
    private Integer pageSize;       //当前页显示内容的数量
    private Integer pageTotalCount; //总数据量
    private List<T> items;          //当前页的数据集合
    private String imgPath ;         //图片路径= "static/img/default.jpg"
    private String url;

    public Page() {
    }

    public Page(Integer pageNumber, Integer pageTotal, Integer pageSize, Integer pageTotalCount, List<T> items) {
        this.pageNumber = pageNumber;
        this.pageTotal = pageTotal;
        this.pageSize = pageSize;
        this.pageTotalCount = pageTotalCount;
        this.items = items;
    }

    public Page(Integer pageNumber, Integer pageTotal, Integer pageSize, Integer pageTotalCount, List<T> items, String imgPath) {
        this.pageNumber = pageNumber;
        this.pageTotal = pageTotal;
        this.pageSize = pageSize;
        this.pageTotalCount = pageTotalCount;
        this.items = items;
        this.imgPath = imgPath;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }

    public Integer getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(Integer pageNumber) {
        this.pageNumber = pageNumber;
    }

    public Integer getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(Integer pageTotal) {
        this.pageTotal = pageTotal;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageTotalCount() {
        return pageTotalCount;
    }

    public void setPageTotalCount(Integer pageTotalCount) {
        this.pageTotalCount = pageTotalCount;
    }

    public List<T> getItems() {
        return items;
    }

    public void setItems(List<T> items) {
        this.items = items;
    }

    @Override
    public String toString() {
        return "Page{" +
                "pageNumber=" + pageNumber +
                ", pageTotal=" + pageTotal +
                ", pageSize=" + pageSize +
                ", pageTotalCount=" + pageTotalCount +
                ", items=" + items +
                ", imgPath='" + imgPath + '\'' +
                ", url='" + url + '\'' +
                '}';
    }
}
